package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.HsVillageMapper;
import com.ruoyi.business.domain.HsVillage;
import com.ruoyi.business.service.IHsVillageService;

/**
 * 小区Service业务层处理
 * 
 * @author asher
 * @date 2021-11-08
 */
@Service
public class HsVillageServiceImpl implements IHsVillageService 
{
    @Autowired
    private HsVillageMapper hsVillageMapper;

    /**
     * 查询小区
     * 
     * @param villageId 小区主键
     * @return 小区
     */
    @Override
    public HsVillage selectHsVillageByVillageId(Long villageId)
    {
        return hsVillageMapper.selectHsVillageByVillageId(villageId);
    }

    /**
     * 查询小区列表
     * 
     * @param hsVillage 小区
     * @return 小区
     */
    @Override
    public List<HsVillage> selectHsVillageList(HsVillage hsVillage)
    {
        return hsVillageMapper.selectHsVillageList(hsVillage);
    }

    /**
     * 新增小区
     * 
     * @param hsVillage 小区
     * @return 结果
     */
    @Override
    public int insertHsVillage(HsVillage hsVillage)
    {
        hsVillage.setCreateTime(DateUtils.getNowDate());
        return hsVillageMapper.insertHsVillage(hsVillage);
    }

    /**
     * 修改小区
     * 
     * @param hsVillage 小区
     * @return 结果
     */
    @Override
    public int updateHsVillage(HsVillage hsVillage)
    {
        hsVillage.setUpdateTime(DateUtils.getNowDate());
        return hsVillageMapper.updateHsVillage(hsVillage);
    }

    /**
     * 批量删除小区
     * 
     * @param villageIds 需要删除的小区主键
     * @return 结果
     */
    @Override
    public int deleteHsVillageByVillageIds(Long[] villageIds)
    {
        return hsVillageMapper.deleteHsVillageByVillageIds(villageIds);
    }

    /**
     * 删除小区信息
     * 
     * @param villageId 小区主键
     * @return 结果
     */
    @Override
    public int deleteHsVillageByVillageId(Long villageId)
    {
        return hsVillageMapper.deleteHsVillageByVillageId(villageId);
    }
}
